﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Flower_5
{
    public partial class MyForm : Form
    {
        LogicFlowers Logic;
        Boquet Buket;
        public MyForm()
        {
            InitializeComponent();
            comboBoxColorGerbera.Text = comboBoxColorGerbera.Items[0].ToString();
            comboBoxColorRose.Text = comboBoxColorRose.Items[0].ToString();            
            Logic = new LogicFlowers();            
            Buket = new Boquet();
        }

        private void buttonAddGerbera_Click(object sender, EventArgs e)
        {
            Logic.AddGerbera(Buket, (int)numericUDMidGerbera.Value, comboBoxColorGerbera.Items[comboBoxColorGerbera.SelectedIndex].ToString());
            MessageBox.Show("Гербера добавлена!");
        }

        private void buttonAddRose_Click(object sender, EventArgs e)
        {            
            Logic.AddGerbera(Buket, (int)numericUDBudRose.Value, comboBoxColorRose.Items[comboBoxColorRose.SelectedIndex].ToString());
            MessageBox.Show("Роза добавлена!");
        }

        private void buttonCalculationPrice_Click(object sender, EventArgs e)
        {
            MessageBox.Show(Logic.CalculationPrice(Buket).ToString(), "Итоговая цена" );
        }

        private void buttonClear_Click(object sender, EventArgs e)
        {
            Buket.FlowerInBuket().Clear();
        }
    }
}
